package widget

import "clientDemo/ui/fyne_ui/widget/interface"

type ButtonCallBack func(item widgetcommon.IWidgetItem, obj widgetcommon.IUserInfo) bool

var ButtonCallBackMap = map[string]ButtonCallBack{}

func RegeditButtonCallBack(buttonName string, cb ButtonCallBack) {
	if ButtonCallBackMap == nil {
		ButtonCallBackMap = make(map[string]ButtonCallBack)
	}
	ButtonCallBackMap[buttonName] = cb
}

func GetButtonCallBack(buttonName string) ButtonCallBack {
	return ButtonCallBackMap[buttonName]
}

func ClearButtonCallBacks() {
	ButtonCallBackMap = make(map[string]ButtonCallBack)
}
